<%@ page import="java.io.File" %>
<%@ page import="java.net.URLEncoder" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/8/22
  Time: 17:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>课件资源管理</title>
    <link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-CCTZv2q9I9m3UOxRLaJneXrrqKwUNOzZ6NGEUMwHtShDJ+nCoiXJCAgi05KfkLGY" crossorigin="anonymous" type="text/css">
    <link href="/SystemerNav/SystemerNav.css" rel="stylesheet" type="text/css">
</head>

<body background="/LoginInterface/loginFace.jpg">
<div class="container">
    <div class="top">
        <table class="pure-table">
            <thead>
            <tr>
                <th>文件名</th>
                <th>删除</th>
                <th>修改</th>
            </tr>
            </thead>
            <tbody>
            <%
                String courseNo=request.getParameter("courseNo");
                String workerNo=request.getParameter("workerNo");
                String dirName=request.getParameter("dirName");//当前学习单元

                /*response.setCharacterEncoding("GBK");
                request.setCharacterEncoding("GBK");*/
                String filePath="F:\\JWGLXT\\web\\StoreResoures\\"+workerNo+"\\"+courseNo;
                File fDir=new File(filePath,dirName);
                //指定目录存在
                if(fDir.isDirectory() && fDir.exists()){
                    String [] f_array=fDir.list();//获取所有目录的文件名
                    for (int i=0;i<f_array.length;i++){
                        String path="F:/JWGLXT/web/StoreResoures/"+workerNo+"/"+courseNo+"/"+dirName+"/"+f_array[i];
           %>

            <tr>
                <td><a href="/TeachLesson/downloadFileServlet?filePath=<%=path%>" target="_blank"><%=f_array[i]%></a> </td>
                <td><a href="/TeachLesson/deleteResoursesServlet?workerNo=<%=workerNo%>&courseNo=<%=courseNo%>&dirName=<%=URLEncoder.encode(dirName,"UTF-8")%>&fileName=<%=URLEncoder.encode(f_array[i],"UTF-8")%>">删除</a></td>
                <td><a href="">修改</a> </td>
            </tr>
            <%
                    }
                }
            %>

            </tbody>
        </table>
    </div>
</div>


</body>
</html>
